﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucQueryUser.ascx.cs" Inherits="WebForm_ManageUser_ucQueryUser" %>
    <%@ Register src="OpenManageUserRoleMapping.ascx" tagname="OpenManageUserRoleMapping" tagprefix="My" %>
<asp:Panel ID="Panel1" runat="server" GroupingText="<%$ Resources:Query %>">

    <table cellpadding="5" cellspacing="5">
        <tr>
            <td>
                <asp:Label ID="lblEmployeeID" runat="server" Text="<%$ Resources:EmployeeID %>"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtEmployeeID" runat="server" MaxLength="50"></asp:TextBox>
            </td>
            <td>
                <asp:Label ID="lblEmployeeName" runat="server" 
                            Text="<%$ Resources:EmployeeName %>"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtEmployeeName" runat="server" MaxLength="50"></asp:TextBox>
            </td>
            <td>
                <asp:Label ID="lblOrganizationID" runat="server" 
                            Text="<%$ Resources:OrganizationName %>"></asp:Label>
            </td>
            <td>
                <TServerControl:TDropDownList ID="ddlOrganizationID" runat="server"
                            DataTextField="OrganizationName" DataValueField="OrganizationID" 
                    ondatabound="ddlOrganizationID_DataBound" 
                    DataSourceID="ObjectDataSource_Organization">
                </TServerControl:TDropDownList>
                <asp:ObjectDataSource ID="ObjectDataSource_Organization" runat="server" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="BLL_SelectMyOrganization" TypeName="BLL_ManageUser">
                    <SelectParameters>
                        <asp:Parameter Name="MyOrganizationID" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </td>
            <td>
                <asp:ImageButton ID="btnQuery" ImageUrl="~/images/image/but_10.jpg" onclick="btnQuery_Click" runat="server" />
            </td>
        </tr>
    </table>
</asp:Panel>
<TServerControl:TGridView ID="TGridView1" runat="server" AllowHoverEffect="True" MouseOverColor="Yellow"
    AllowHoverSelect="True" ShowFooterWhenEmpty="False"
    ShowHeaderWhenEmpty="False" TotalRowCount="0" AutoGenerateColumns="False" DataKeyNames="EmployeeID"
    SkinID="pager" onselectedindexchanged="TGridView1_SelectedIndexChanged">
    <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:LinkButton ID="lbtnEdit" runat="server" Text="<%$ Resources:Edit %>" CommandName="Select"
                    CausesValidation="False"></asp:LinkButton>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
        
                <asp:TemplateField>
            <ItemTemplate>
                <asp:LinkButton ID="lbtnDelete" runat="server" CommandName="Delete" Text="<%$ Resources:Delete %>"
                    CausesValidation="False" OnClientClick="<%$ Resources:DeleteConfirm %>"></asp:LinkButton>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
        
        
        
        <asp:BoundField DataField="EmployeeID" HeaderText="<%$ Resources:EmployeeID %>" SortExpression="EmployeeID"
            ReadOnly="True">
            <ItemStyle Width="22%" />
        </asp:BoundField>
        
                <asp:BoundField DataField="EmployeeName" HeaderText="<%$ Resources:EmployeeName %>" SortExpression="EmployeeName"
            ReadOnly="True">
            <ItemStyle Width="22%" />
        </asp:BoundField>
                        <asp:BoundField DataField="OrganizationName" HeaderText="<%$ Resources:OrganizationName %>" SortExpression="OrganizationName"
            ReadOnly="True">
            <ItemStyle Width="22%" />
        </asp:BoundField>      
        
       
        <asp:TemplateField HeaderText="<%$ Resources:Active %>" SortExpression="Active">

            <ItemTemplate>
                <asp:CheckBox ID="chkActive0" runat="server" Checked='<%# BooleanConverter(Eval("Active")) %>'
                    Enabled="False" />
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
       
        <asp:TemplateField HeaderText="<%$ Resources:SetupRole %>">
            <EditItemTemplate>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:LinkButton ID="lbtnSetup" runat="server" Text="<%$ Resources:Setup %>" 
                    onclick="lbtnSetup_Click"></asp:LinkButton>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
    </Columns>
</TServerControl:TGridView>
<asp:ObjectDataSource ID="ObjectDataSource_User" runat="server"
    OldValuesParameterFormatString="original_{0}" SelectMethod="BLL_Select" 
    TypeName="BLL_ManageUser" DeleteMethod="BLL_Delete"
>

    <DeleteParameters>
        <asp:Parameter Name="original_EmployeeID" Type="String" />
    </DeleteParameters>

    <SelectParameters>
        <asp:Parameter Name="EmployeeID" Type="String" />
        <asp:Parameter Name="EmployeeName" Type="String" />
        <asp:Parameter Name="OrganizationID" Type="String" />
        <asp:Parameter Name="MyOrganizationID" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>
<My:OpenManageUserRoleMapping ID="OpenManageUserRoleMapping1" runat="server" />
